class Admin::SwarmController < Admin::AdminBaseController
before_filter :admin_required
  def list
   @catelogs=Catelog.find(:all)
  if(!params[:id].nil?)then condition="catelog_id = "+params[:id] end
  @result_pages,@swarm=paginate(:swarms,:order=>"creation_time",:conditions=>condition,:per_page=>2)
  end

  def delete
  s=Swarm.find(params[:id])
  if(s.nil?)then return end
  Swarm.delete(params[:id])
  flash[:notice]="you have delete the swarm "+s.title
  redirect_to :back
  end
end
